package com.siwei.mes.mapper.experiment;

import com.siwei.mes.common.base.BaseMapper;
import com.siwei.mes.entity.erp.Itemorder;
import com.siwei.mes.entity.experiment.ExperimentItemorder;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 试验台账与小票关系(ExperimentItemorder)表数据库访问层
 *
 * @author linzi
 * @since 2023-12-19 22:36:28
 */
public interface ExperimentItemorderMapper extends BaseMapper<ExperimentItemorder> {
    /**
     * 获取所有
     *
     * @param entity
     * @return
     */
    List<ExperimentItemorder> getList(ExperimentItemorder entity);

    /**
     * 根据id获取
     *
     * @param id
     * @return
     */
    ExperimentItemorder loadById(@Param("id") Long id);

    /**
     * 根据试验台账id获取小票id
     *
     * @param experimentId
     * @return
     */
    List<Itemorder> selectByExperimentId(@Param("experimentId") Long experimentId);

    /**
     * 根据试验台账id获取小票id
     *
     * @param experimentId
     * @return
     */
    List<Itemorder> selectByExperimentIdFrwdh(@Param("experimentId") Long experimentId, @Param("frwdh") Integer frwdh);

    Double selectByRealBehalfNumberByExperimentId(@Param("experimentId") Long experimentId);

    /**
     * 根据小票号查询所有绑定关系
     *
     * @param itemorderId 小票号
     * @return
     */
    List<Long> selectByItemorderId(@Param("itemorderId") Integer itemorderId);

    /**
     * 根据试验委托id删除
     *
     * @param experimentId 试验委托id
     */
    void deleteByExperimentId(@Param("experimentId") Long experimentId);

    /**
     * 根据试验委托id获取所有工程名称
     *
     * @param experimentId
     * @return
     */
    String getProjectNameStr(@Param("experimentId") Long experimentId);
}
